package com.kyp.basic;

public class BasicCalcBean {

	public final static String KEY_SUM = "합계";
	public final static String KEY_AVG = "산술평균";
	public final static String KEY_MAX = "최대값";
	public final static String KEY_MIN = "최소값";
	public final static String KEY_COUNT = "개수";
	public final static String KEY_GEOMEAN = "기하평균";
	public final static String KEY_MEDIAN = "중앙값";
	public final static String KEY_STDDEV = "표준편차";
	public final static String KEY_VARIANCE = "분산";
	
	private Double mSum;
	private Double mAvg; // 산술평균
	private Double mMax;
	private Double mMin;
	private Double mCount;
	private Double mGeoMean; // 기하평균
	private Double mMed; // 중앙값
	private Double mStddev; // 표준편차
	private Double mVar; // 분산

	public static final class Builder {

		private Double mSum;
		private Double mAvg;
		private Double mMax;
		private Double mMin;
		private Double mCount;
		private Double mGeoMean;
		private Double mMed;
		private Double mStddev;
		private Double mVar;

		public Builder sum(Double sum) {
			this.mSum = sum;
			return this;
		}

		public Builder avg(Double avg) {
			this.mAvg = avg;
			return this;
		}

		public Builder max(Double max) {
			this.mMax = max;
			return this;
		}

		public Builder min(Double min) {
			this.mMin = min;
			return this;
		}

		public Builder count(Double count) {
			this.mCount = count;
			return this;
		}

		public Builder geoMean(Double geoMean) {
			this.mGeoMean = geoMean;
			return this;
		}

		public Builder med(Double med) {
			this.mMed = med;
			return this;
		}

		public Builder stddev(Double stddev) {
			this.mStddev = stddev;
			return this;
		}

		public Builder var(Double var) {
			this.mVar = var;
			return this;
		}

		public BasicCalcBean build() {
			return new BasicCalcBean(this);
		}
	}

	private BasicCalcBean(Builder builder) {
		this.mSum = builder.mSum;
		this.mAvg = builder.mAvg;
		this.mMax = builder.mMax;
		this.mMin = builder.mMin;
		this.mCount = builder.mCount;
		this.mGeoMean = builder.mGeoMean;
		this.mMed = builder.mMed;
		this.mStddev = builder.mStddev;
		this.mVar = builder.mVar;
	}

	public Double getSum() {
		return this.mSum;
	}

	public Double getAvg() {
		return this.mAvg;
	}

	public Double getMax() {
		return this.mMax;
	}

	public Double getMin() {
		return this.mMin;
	}

	public Double getCount() {
		return this.mCount;
	}

	public Double getGeoMean() {
		return this.mGeoMean;
	}

	public Double getMed() {
		return this.mMed;
	}

	public Double getStddev() {
		return this.mStddev;
	}

	public Double getVar() {
		return this.mVar;
	}
}
